<template>
	<fui-tabbar background="#fff" color="#8a8a8a" selectedColor="#13a1ff" size="28"  @click="itemClick" font-weight="500" :tabBar="tabBar" :current="current"></fui-tabbar>
</template>

<script>
	import {methods,baseUrl} from '@/utils/core.js';
	export default {
		name:'toolbar',
		data() {
			return {
				tabBar: [
					{
						text: "首页",
						iconPath: baseUrl+"assets/img/miniapp/home.png",
						selectedIconPath: baseUrl+"assets/img/miniapp/home_a.png",
						page:'parking/index'
					},
					{
						text: "监控",
						iconPath: baseUrl+"assets/img/miniapp/jiankong.png",
						selectedIconPath: baseUrl+"assets/img/miniapp/jiankong_a.png",
						page:'parking/barriers'
					},
					{
						text: "功能",
						iconPath: baseUrl+"assets/img/miniapp/gongneng.png",
						selectedIconPath: baseUrl+"assets/img/miniapp/gongneng_a.png",
						page:'parking/menus'
					},
					{
						text: "我的",
						iconPath: baseUrl+"assets/img/miniapp/user.png",
						selectedIconPath: baseUrl+"assets/img/miniapp/user_a.png",
						page:'parking/user'
					}
				]
			}
		},
		props:{
			current:{
				type:Number,
				default:0
			}
		},
		mounted(){
			
		},
		methods: {
			...methods,
			tips:function(index,number){
				if(number>0){
					this.tabBar[index].badge=number;
				}else{
					delete this.tabBar[index].badge;
				}
			},
			itemClick:function(e){
				this.$reLaunch(this.tabBar[e.index].page);
			}
			
		}
	}
</script>

<style lang="scss" scoped>
	
</style>